home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
2_12.lha
/
2_12
/
2_12.c
next >
Wrap
Text File
|
1993-08-08
|
540b
|
21 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ print the size of a string array
include <stream.h>
include <string.h>
har Str[] = "a short string";
nt main(int, char**)
cout << "sizeof(Str)=" << sizeof(Str) << "\n";
cout << "strlen(Str)=" << strlen(Str) << "\n";
cout << "sizeof(\"a short string\")=" <<
sizeof("a short string") << "\n";
cout << "strlen(\"a short string\")=" <<
strlen("a short string") << "\n";
return 0;